package com.ruoyi.system.service.impl;

import java.util.List;

import com.ruoyi.common.core.domain.entity.YxAndroidApplicationVo;
import com.ruoyi.common.utils.DateUtils;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.YxAndroidApplicationMapper;
import com.ruoyi.system.domain.YxAndroidApplication;
import com.ruoyi.system.service.IYxAndroidApplicationService;

/**
 * android应用Service业务层处理
 * 
 * @author lingyu
 * @date 2024-03-04
 */
@Service
public class YxAndroidApplicationServiceImpl implements IYxAndroidApplicationService 
{
    @Autowired
    private YxAndroidApplicationMapper yxAndroidApplicationMapper;

    /**
     * 查询android应用
     * 
     * @param id android应用主键
     * @return android应用
     */
    @Override
    public YxAndroidApplication selectYxAndroidApplicationById(Long id)
    {
        return yxAndroidApplicationMapper.selectYxAndroidApplicationById(id);
    }

    @Override
    public YxAndroidApplication selectYxAndroidApplicationByPackageName(String packageName) {
        return yxAndroidApplicationMapper.selectYxAndroidApplicationByPackageName(packageName);
    }

    @Override
    public List<YxAndroidApplication> selectYxAndroidApplicationByPackageNames(List<String> packageNames) {
        return yxAndroidApplicationMapper.selectYxAndroidApplicationByPackageNames(packageNames);
    }

    /**
     * 查询android应用列表
     * 
     * @param yxAndroidApplication android应用
     * @return android应用
     */
    @Override
    public List<YxAndroidApplication> selectYxAndroidApplicationList(YxAndroidApplication yxAndroidApplication)
    {
        return yxAndroidApplicationMapper.selectYxAndroidApplicationList(yxAndroidApplication);
    }

    /**
     * 查询android应用列表
     *
     * @param deviceId deviceId
     * @return android应用集合
     */
    public List<YxAndroidApplicationVo> selectYxAndroidApplicationByDeviceId(String deviceId){
        return yxAndroidApplicationMapper.selectYxAndroidApplicationByDeviceId(deviceId);
    }

    /**
     * 查询android应用列表
     *
     * @param deviceId deviceId
     * @param status status
     * @return android应用集合
     */
    public List<YxAndroidApplicationVo> selectYxAndroidApplicationByDeviceIdAndStatus(String deviceId,Integer status){
        return yxAndroidApplicationMapper.selectYxAndroidApplicationByDeviceIdAndStatus(deviceId, status);
    }


    /**
     * 新增android应用
     * 
     * @param yxAndroidApplication android应用
     * @return 结果
     */
    @Override
    public int insertYxAndroidApplication(YxAndroidApplication yxAndroidApplication)
    {
        yxAndroidApplication.setCreateTime(DateUtils.getNowDate());
        return yxAndroidApplicationMapper.insertYxAndroidApplication(yxAndroidApplication);
    }

    @Override
    public int insertYxAndroidApplications(List<YxAndroidApplication> yxAndroidApplications) {
        return yxAndroidApplicationMapper.insertYxAndroidApplications(yxAndroidApplications);
    }

    /**
     * 修改android应用
     * 
     * @param yxAndroidApplication android应用
     * @return 结果
     */
    @Override
    public int updateYxAndroidApplication(YxAndroidApplication yxAndroidApplication)
    {
        return yxAndroidApplicationMapper.updateYxAndroidApplication(yxAndroidApplication);
    }

    @Override
    public int updateYxAndroidApplications(List<YxAndroidApplication> yxAndroidApplications) {
        return yxAndroidApplicationMapper.updateYxAndroidApplications(yxAndroidApplications);
    }

    /**
     * 批量删除android应用
     * 
     * @param ids 需要删除的android应用主键
     * @return 结果
     */
    @Override
    public int deleteYxAndroidApplicationByIds(Long[] ids)
    {
        return yxAndroidApplicationMapper.deleteYxAndroidApplicationByIds(ids);
    }

    /**
     * 删除android应用信息
     * 
     * @param id android应用主键
     * @return 结果
     */
    @Override
    public int deleteYxAndroidApplicationById(Long id)
    {
        return yxAndroidApplicationMapper.deleteYxAndroidApplicationById(id);
    }
}
